using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using System.ComponentModel;

namespace mdv.wssSchemaExplorer.WSS
{
    public class wssFieldRefsController : IController
    {
        public wssFieldRefsController(wssFieldRefs fieldRefs)
        {
            _actions = new ContextMenu();
            _actions.MenuItems.Add(new MenuItem("Add FieldRef"));
            _fieldRefs = fieldRefs;
            if (null != _fieldRefs.FieldRefs)
                foreach (wssFieldRef fr in _fieldRefs.FieldRefs) _children.Add(new wssFieldRefController(fr));
        }
        public override string ToString()
        {
            return _fieldRefs.ToString();
        }
        #region IController Members
        private List<IController> _children = new List<IController>();
        [Browsable(false)]
        public List<IController> Children
        {
            get { return _children; }
        }
        private ContextMenu _actions;
        [Browsable(false)]
        public ContextMenu Actions
        {
            get { return _actions; }
        }
        private wssFieldRefs _fieldRefs = null;
        [Browsable(false)]
        public object Model
        {
            get { return _fieldRefs; }
        }
        #endregion
    }
}